#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<list>
#include<vector>
#include<algorithm>

using namespace std;
#include"list.h"
//void Test_list1()
//{
//	list<int> It;
//	It.push_back(1);
//	It.push_back(2);
//	It.push_back(3);
//	It.push_back(4);
//	It.push_back(5);
//
//	list<int>::iterator it = It.begin();
//	while (it != It.end())
//	{
//		cout << *it << " ";
//		it++;
//	}
//	cout << endl;
//	for (auto e : It)
//	{
//		cout << e << " ";
//	}
//	cout << endl;
//	list<int> It2;
//	It2.assign(It.begin(), It.end());
//	for (auto e : It2)
//	{
//		cout << e << " ";
//	}
//	cout << endl;
//}
//void Test_list2()
//{
//	list<int> It;
//	It.push_back(1);
//	It.push_back(2);
//	It.push_back(3);
//	It.push_back(4);
//	It.push_back(5);
//	It.push_front(10);
//	for (auto e : It)
//	{
//		cout << e << " ";
//	}
//	cout << endl;
//	It.reverse();
//	/*It.clear();
//	cout << It.size() << endl ;*/
//	for (auto e : It)
//	{
//		cout << e << " ";
//	}
//	cout << endl;
//	/*It.sort();
//	for (auto e : It)
//	{
//		cout << e << " ";
//	}
//	cout << endl;*/
//	sort(It.begin(), It.end());
//	for (auto e : It)
//	{
//		cout << e << " ";
//	}
//	cout << endl;
//}
void Test_list3()
{
	list<int> It;
	It.push_back(1);
	It.push_back(2);
	It.push_back(3);
	It.push_back(4);
	It.push_back(5);
	It.push_back(2);
	It.push_back(2);
	It.sort();
	It.unique();
	//It.sort();
	//It1.sort();
	//It.merge(It1);
	for (auto e : It)
	{
		cout << e << " ";
	}
	cout << endl;
	It.remove(3);
	for (auto e : It)
	{
		cout << e << " ";
	}
	cout << endl;
}
void Test_list4()
{
	list<int> It;
	It.push_back(1);
	It.push_back(2);
	It.push_back(3);
	It.push_back(4);
	//It.push_back(5);
	//list<int> It1;
	//It1.push_back(10);
	//It1.push_back(20);
	//It1.push_back(30);
	//It1.push_back(40);
	//It1.push_back(50);
	////It.splice(It.begin(),It1,++It1.begin());
	//It.splice(It.begin(), It1, ++It1.begin(),--It1.end());
	list<int>::reverse_iterator rit = It.rbegin();
	while (rit!=It.rend())
	{
		cout << *rit << " ";
		rit++;
	}
	cout << endl;
}
int main()
{
	Test_list4();
	return 0;
}
